<?php
/**
 * @Author: Marte
 * @Date:   2017-08-11 14:30:11
 * @Last Modified by:   Marte
 * @Last Modified time: 2017-08-22 10:49:01
 */
?>
<div class="change1">
       <div class="top_left">
            <div class="top_left_top">
            <div class="gaisu">
                <p><?php echo $_assoc['descripation'];?></p>
                <div class="biaoqian">
                    <span class="biaoqian_title">作者自定义标签</span><span class="bq_1">

                         <?php
                    $_p=$_assoc['typeid'];
                    switch($_p)
                    {
                                    case 1:echo "玄幻" ;break;
                                    case 2:echo "奇幻";break;
                                    case 3:echo "武侠";break;
                                    case 4:echo "仙侠";break;
                                    case 5:echo "都市";break;
                                    case 6:echo "现实";break;
                                    case 7:echo "历史";break;
                                    case 8:echo "军事";break;
                                    case 9:echo "校园";break;
                                    case 10:echo "游戏";break;
                                    case 11:echo "言情";break;
                                    case 12:echo "灵异";break;
                                    case 13:echo "N次元";break;
                    }
                ?>
                    </span><span class="bq_1"><?php echo $_assoc['lable'];?></span>
                </div>
            </div>
            <div class="hover">
                <span class="ho_left">荣誉动态</span>
                <span class="ho_right">2017-08-20 累积获得<?php echo $_assoc['select_num'];?>个收藏</span>
                <ul>
                    <li><img src="images/hover.png" alt=""></li>

                </ul>
            </div>
            <div class="zjgx">
                <span class="zj_left">最近更新</span>
                <?php
                    if(isset($assoc3['secnum']))
                    {
                ?>
                <span class="zj_f"><a href="read_page.php?change=2&bookid=<?php echo $assoc3['bookid']?>&secnum=<?php echo $assoc3['secnum']?>" title="">第<?php chinanum($assoc3['secnum']);?>章 <?php echo $assoc3['secname']?></a><span class="zj_time"><?php echo $assoc3['uploadtime']?></span></span>
                <?php
                    }else{
                        echo'<span class="zj_f">第0章 <span class="zj_time">2017-08-20</span></span>';
                    }
                ?>
            </div>
           </div>
            <span class="das">打赏互动</span>
           <div class="fan">
                <ul>
                    <li class="yes">
                        <span class="fan_title">月票  |  推荐票</span>
                        <span class="fan_piao">本月月票数</span>
                        <span class="fan_piao_num"><?php echo $_assoc['recom'];?></span>
                        <span class="fan_pai">当前排名1200名</span>
                        <i><img src="images/piao.png" alt=""></i>
                        <span class="tou"><a href="common/add_recom.php?id=<?php echo $_assoc['bookid'];?>" title="">投月票</a></span>
                    </li>
                    <li class="yes">
                        <span  class="fan_title">打赏</span>
                         <span class="fan_piao">总打赏人数</span>
                        <span class="fan_piao_num"><?php echo $_assoc['shang']; ?></span>
                        <span class="fan_pai">今日0人打赏</span>
                        <i><img src="images/dashang.png" alt=""></i>
                        <span class="tou"><a href="" title="">打赏作者</a></span>
                    </li>
                    <li class="no">
                         <span class="fan_title">粉丝动态</span>
                         <dl>
                         <?php
                         $id=$_assoc['bookid'];
                                $a='select * from recom where bookid="'.$id.'" order by time desc limit 0,5';
                                $_res=$_mysql->query($a);

                                while($_ass=$_res->fetch_assoc())
                                {

                                    echo '<dd>书友'.$_ass['username'].'投了'.$_ass['num'].'张推荐票</dd>';
                                }
                         ?>

                         </dl>
                         <span class="tou"><a href="" title="">发表评论</a></span>
                    </li>
                </ul>
           </div>
       </div>
       <div class="top_right1">
            <i class="pp"><img src="images/author11.png" alt=""></i>
            <span class="author_name"><?php echo $_assoc['bookauthor'];?></span>
            <ul>
            <?php
                $ss='select * from author where penname="'.$_assoc['bookauthor'].'"';
                $re=$_mysql->query($ss);
                $_a=$re->fetch_assoc();
            ?>
                <li><img src="images/booktotal.png" alt=""><span class="all_1">作品总数</span><span class="all_2">
                <?php
                    if($_a['totalworks']!='')
                    {
                        echo $_a['totalworks'].'本';
                    }else
                    {
                        echo "未记录";
                    }
                ?></span></li>
                <li><img src="images/leiji.png" alt=""><span class="all_1">累计字数</span><span class="all_2"> <?php
                    if($_a['totalwords']!='')
                    {
                        echo $_a['totalwords'].'万';
                    }else
                    {
                        echo "未记录";
                    }
                ?></span></li>
                <li><img src="images/chuangzuo.png" alt=""><span class="all_1">创作天数</span><span class="all_2"> <?php
                    if($_a['days']!='')
                    {
                        echo $_a['days'].'天';
                    }else
                    {
                        echo "未记录";
                    }
                ?></span></li>
            </ul>
            <span class="other">其他作品</span>
            <div class="win">

    <div class="title">
    <?php
            //首先查询该作者的小说总共有几个，

            mysqli_query($_mysql,'select bookid from books where bookauthor="'.$_assoc['bookauthor'].'"');
            $nu=mysqli_affected_rows($_mysql);
            if($nu>=5)
            {
                $nu=5;
            }

            for($i=0;$i<$nu;$i++)
            {
                echo '<a href="javascript:;" style="color:#fff">'.($i+1).'</a>';
            }
    ?>


        <div class="float"></div>
    </div>

    <div class="box">

         <?php
            $p='select * from books where bookauthor="'.$_assoc['bookauthor'].'" order by bookid desc limit 0,'.$nu.'';
            $t=$_mysql->query($p);
            $j=0;
            while($o=$t->fetch_assoc())
            {
        ?>
        <div class="color<?php echo ($j+1);?>" style="left:0">
            <i><img src="<?php echo $o['picpath'];?>" alt=""></i>
            <span class="box_title"><?php echo $o['bookname'];?></span>
            <p><?php echo $o['descripation'];?></p>
            <span class="box_read"><a href="bookinfo.php?action=xx&id=<?php echo $o['bookid'];?>" title="">立即阅读</a></span>
        </div>
        <?php
}
        ?>
    </div>

    <!-- <div class="leftB">&lt;</div>
    <div class="rightB">&gt;</div> -->

</div>
       </div>
    </div>
